<?php
header("Content-type: text/html; charset=utf-8");
//时间参数
date_default_timezone_set('Asia/Shanghai');


error_reporting(E_ALL); 
//ini_set('display_errors', '1'); 
ini_set('display_errors', '1');


   
function cache_shutdown_error() {  
   
    $_error = error_get_last();  

    if(isset($_GET['debug'])){
        if ($_error && in_array($_error['type'], array(1, 4, 16, 64, 256, 4096, E_ALL))) {  

            header("debug-error-file:" . $_error['file'] . "\tline : " . $_error['line']);
            echo $_error['message']."\n";
        }
    }
}  
   
register_shutdown_function("cache_shutdown_error");  


$strpath = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR; //"/www/htdocs/appkfsy/admin/inc/";



require_once($strpath . 'definition.inc.php');
require_once($strpath . 'DBHelper.inc.php');
require_once($strpath . 'functions.php');
require_once($strpath . "class.DB.php");
require_once($strpath . "class.Memcache.php");
require_once($strpath . "DBModel.class.php");


/*class Memcache_cc extends Memcache
{
    function Memcache_cc()
    {
        $this->addServer('101.200.129.233', 12000, false, 2, 1, -1, 1);
        //$this->addServer('123.57.145.37', 12002, false, 2, 1, -1, 1 );
        //$this->addServer('123.57.145.37', 12003, false, 2, 1, -1, 1 );
        //$this->addServer('123.57.145.37', 12004, false, 2, 1, -1, 1 );
        //$this->addServer('123.57.145.37', 12005, false, 2, 1, -1, 1 );
        //$this->addServer('34c1f77593b54a42.m.cnbjalicm12pub001.ocs.aliyuncs.com', 11211, false, 2, 1, -1, 1 );
    }
}

$mc = new Memcache_cc;*/

$db = new DBHelper();
$db->connect();



$options = array();
$options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES utf8mb4';
$pdo = new PDO('mysql:host='.DBR_HOST,DBW_USERNAME,DBW_PASSWORD, $options);

//!isset($no_require_login) and $cur_user_id <= 0 and (header('location:/admin/login.php') || exit);
//!isset($no_require_auth) && !authentication($cur_user_id) && exit('您没有权限访问此页面');

function ajax_message($status, $message = '', $extra = array())
{
    header('Content-Type:application/json; charset=utf-8');
    $data['status'] = $status;
    $message && $data['message'] = $message;
    $extra && $data = array_merge($data, $extra);
    exit(json_encode($data));
}


